package com.s59.rbac.common;

import lombok.Data;

@Data
public class R {
    private int code;
    private String message;
    private Object data;

    public R() {
    }

    public R(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static R ok(){
        return new R(200,"成功", null);
    }

    public static R ok(Object data){
        return new R(200,"成功", data);
    }

    public static R err(String message){
        return new R(500, message,null);
    }

    public static R err(int code ,String message){
        return new R(code, message,null);
    }

}
